﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using MySql.Data.MySqlClient;

namespace Lm.Common.DAL.MySql
{
    public class MySqlParameterManager
    {
        public List<MySqlParameter> SqlParameterList { get; set; }
        protected int Count { get; set; }
        public MySqlParameterManager(List<MySqlParameter> sqlParameterList)
        {
            this.Count = 0;
            this.SqlParameterList = sqlParameterList;
        }
        public MySqlParameter Create(object value)
        {
            this.Count++;
            MySqlParameter parameter = new MySqlParameter("@p" + this.Count, value);
            if (parameter.Value == null)
            { parameter.Value = DBNull.Value; }
            this.SqlParameterList.Add(parameter);
            return parameter;
        }
    }
}
